package com.maimao.model.dynamicform.validate;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.ArrayList;
import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/12/19 9:52 下午
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class NumberValidate extends Validate {

    private Integer min;
    private Integer max;

    public NumberValidate() {
        super.setType("number");
        min = 0;
    }

    public static List<Validate> getDefaultNumberValidates() {
        List<Validate> validates = new ArrayList<>(1);
        NumberValidate validate = new NumberValidate();
        validate.setTrigger("change");
        validate.setMessage("不能小于0");
        validates.add(validate);
        return validates;
    }

    public Integer getMin() {
        return min;
    }

    public void setMin(Integer min) {
        this.min = min;
    }

    public Integer getMax() {
        return max;
    }

    public void setMax(Integer max) {
        this.max = max;
    }
}
